package com.bjc.sdx;

import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.bjc.sdx.activity.BaseAdapterActivity;
import com.bjc.sdx.activity.DrawerActivity;
import com.bjc.sdx.activity.DrawerActivity2;
import com.bjc.sdx.activity.FrameActivity;
import com.bjc.sdx.activity.GridViewActivity;
import com.bjc.sdx.activity.MyFragmentActivity;
import com.bjc.sdx.activity.ViewPagerActivity;
import com.bjc.sdx.activity.ViewPagerActivity2;

public class MainActivity extends AppCompatActivity {
    private Button button;
    private Button button1;
    private Button button3;
    private Button button4;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main); // 先设置布局

        button = findViewById(R.id.btn);
        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent();
//                intent.setClass(MainActivity.this, ViewPagerActivity.class);
//                intent.setClass(MainActivity.this, FrameActivity.class);
//                intent.setClass(MainActivity.this, BaseAdapterActivity.class);
//                intent.setClass(MainActivity.this, ViewPagerActivity.class);
//                intent.setClass(MainActivity.this, DrawerActivity.class);
                intent.setClass(MainActivity.this, GridViewActivity.class);
                MainActivity.this.startActivity(intent);
            }
        });

        button1 = findViewById(R.id.btn1);
        button1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent();
                intent.setClass(MainActivity.this, ViewPagerActivity2.class);
                MainActivity.this.startActivity(intent);
            }
        });

        button3 = findViewById(R.id.btn3);
        button3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent();
                intent.setClass(MainActivity.this, DrawerActivity.class);
                MainActivity.this.startActivity(intent);
            }
        });


        button4 = findViewById(R.id.btn4);
        button4.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent();
                intent.setClass(MainActivity.this, MyFragmentActivity.class);
                MainActivity.this.startActivity(intent);
            }
        });

    }
}